package com.lht.designPattern.state;

/**
 * @author Eric
 * @version 1.0
 * @date 2019-10-12
 */
public class WaitPayState implements OrderState {

    @Override
    public boolean isChange(Order order, Integer state) {
        // 订单状态只能从 0 -> 1
        return order.getOrderState() == 0 && state == 1;
    }

    @Override
    public void change(Order order, Integer state) {
        order.setOrderState(1);
        System.out.println("用户状态从 初始化  到 等待支付逻辑");
    }

}
